#import "WWMatrixAdditions.h"

@implementation Matrix(WWMatrixAdditions)

// this is somewhat dangerous, as I'm only going by what the NeXT doc
// says the normal Matrix class does here.  If they do something
// undocumented, well, I'm screwed, because I can't get at Matrix's
// original implementation of this method.  Unfortunately, since
// the IBEditor stuff that goes with Matrix is undocumented, I lose
// all sorts of nifty abilities if I subclass, and I don't want to have
// to do all the work of Ranker...  sigh....  

// define this so that we don't get complaints, but don't have to include other stuff...
- updateInterp { return self; }

- sendAction:(SEL)theAction to:theTarget
{
  if ([[self selectedCell] respondsTo:@selector(updateInterp)])
  {  [[self selectedCell] updateInterp];
  }
  if (theAction && theTarget)
  {  return [super sendAction:theAction to:theTarget];
  }
  if (!theAction)
  {  if (!theTarget)
     {  return [super sendAction:[self action] to:[self target]];
     } 
     else
     {  return [super sendAction:[self action] to:theTarget];
     }
  }
  if (!theTarget)
  {  return [super sendAction:theAction to:[self target]];
  }
  return nil;
}

- changeFont:sender
{
  [[self selectedCell] setFont:[sender convertFont:[cell font]]];
  return self;
}

- changeIBFont:sender
{
  [cell setFont:[sender convertFont:[cell font]]];
  if ([cell respondsTo:@selector(updateInterp)])
  {  [cell updateInterp];
  }
  return self;
}


@end
